﻿@model ThienVienDiDaTu.Models.AlbumAnh

@{
    ViewBag.Title = "AlbumEdit";
}

<h2>Soạn Album</h2>

<div id="bd">
    <div class="box_mess">
        @using (Html.BeginForm("SaveAlbum", "Admin", null, FormMethod.Post, new {@id = "album_form"}))
        {                                                                                                                
            @Html.HiddenFor(m => m.ID)
            @Html.TextBoxFor(a => a.TenAlBum, new { @onclick = "if (this.value=='Nhập tên album') this.value=''", @onblur = "if (this.value=='') this.value='Nhập tên album'", @style = "width: 300px; color: #000; line-height: 20px; height: 20px" })
        }

        @Html.Partial("Partials/UploadPhotoPartial", Model.ID)
        
        
        <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"  type="text/javascript"></script>
        <div id="list-photos">
            @Html.Partial("Partials/ListPhotosPartial", Model.DsAnh)
        </div>
        <br/>
        
         @Html.ActionLink("Hoàn tất", "", "", null, new {@style="color: #000", @id="complete-button"})
        
        <script type="text/javascript">
            $(document).ready(function () {
                $("#complete-button").bind("click", function (event) {
                    //window.event.returnValue = false;  -> not compatible with firefox
                    event.preventDefault();
                    $("#album_form").submit();
                });
            });
        </script>

    </div>
</div>
